<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <title>Release 3.1: DB-&gt;stat</title>
    <link rel="stylesheet" href="gettingStarted.css" type="text/css" />
    <meta name="generator" content="DocBook XSL Stylesheets V1.73.2" />
    <link rel="start" href="index.html" title="Berkeley DB Programmer's Reference Guide" />
    <link rel="up" href="upgrade_3_1_toc.html" title="Chapter 34. Upgrading Berkeley DB 3.0 applications to Berkeley DB 3.1" />
    <link rel="prev" href="upgrade_3_1_dup.html" title="Release 3.1: identical duplicate data items" />
    <link rel="next" href="upgrade_3_1_sysmem.html" title="Release 3.1: DB_SYSTEM_MEM" />
  </head>
  <body>
    <div class="navheader">
      <table width="100%" summary="Navigation header">
        <tr>
          <th colspan="3" align="center">Release 3.1: DB-&gt;stat</th>
        </tr>
        <tr>
          <td width="20%" align="left"><a accesskey="p" href="upgrade_3_1_dup.html">Prev</a> </td>
          <th width="60%" align="center">Chapter 34. Upgrading Berkeley DB 3.0 applications to Berkeley DB 3.1</th>
          <td width="20%" align="right"> <a accesskey="n" href="upgrade_3_1_sysmem.html">Next</a></td>
        </tr>
      </table>
      <hr />
    </div>
    <div class="sect1" lang="en" xml:lang="en">
      <div class="titlepage">
        <div>
          <div>
            <h2 class="title" style="clear: both"><a id="upgrade_3_1_btstat"></a>Release 3.1: DB-&gt;stat</h2>
          </div>
        </div>
      </div>
      <p>For Btree database statistics, the <a href="../api_reference/C/dbstat.html" class="olink">DB-&gt;stat()</a> method field
<span class="bold"><strong>bt_nrecs</strong></span> has been removed, replaced by two fields:
<span class="bold"><strong>bt_nkeys</strong></span> and <span class="bold"><strong>bt_ndata</strong></span>.  The <span class="bold"><strong>bt_nkeys</strong></span> field returns
a count of the unique keys in the database.  The <span class="bold"><strong>bt_ndata</strong></span> field
returns a count of the key/data pairs in the database.  Neither exactly
matches the previous value of the <span class="bold"><strong>bt_nrecs</strong></span> field, which returned
a count of keys in the database, but, in the case of Btree databases,
could overcount as it sometimes counted duplicate data items as unique
keys.  The application should be searched for any uses of the
<span class="bold"><strong>bt_nrecs</strong></span> field and the field should be changed to be either
<span class="bold"><strong>bt_nkeys</strong></span> or <span class="bold"><strong>bt_ndata</strong></span>, whichever is more appropriate.</p>
      <p>For Hash database statistics, the <a href="../api_reference/C/dbstat.html" class="olink">DB-&gt;stat()</a> method field
<span class="bold"><strong>hash_nrecs</strong></span> has been removed, replaced by two fields:
<span class="bold"><strong>hash_nkeys</strong></span> and <span class="bold"><strong>hash_ndata</strong></span>.  The <span class="bold"><strong>hash_nkeys</strong></span> field
returns a count of the unique keys in the database.  The
<span class="bold"><strong>hash_ndata</strong></span> field returns a count of the key/data pairs in the
database.  The new <span class="bold"><strong>hash_nkeys</strong></span> field exactly matches the previous
value of the <span class="bold"><strong>hash_nrecs</strong></span> field.  The application should be
searched for any uses of the <span class="bold"><strong>hash_nrecs</strong></span> field, and the field
should be changed to be <span class="bold"><strong>hash_nkeys</strong></span>.</p>
      <p>For Queue database statistics, the <a href="../api_reference/C/dbstat.html" class="olink">DB-&gt;stat()</a> method field
<span class="bold"><strong>qs_nrecs</strong></span> has been removed, replaced by two fields:
<span class="bold"><strong>qs_nkeys</strong></span> and <span class="bold"><strong>qs_ndata</strong></span>.  The <span class="bold"><strong>qs_nkeys</strong></span> field returns
a count of the unique keys in the database.  The <span class="bold"><strong>qs_ndata</strong></span> field
returns a count of the key/data pairs in the database.  The new
<span class="bold"><strong>qs_nkeys</strong></span> field exactly matches the previous value of the
<span class="bold"><strong>qs_nrecs</strong></span> field.  The application should be searched for any uses
of the <span class="bold"><strong>qs_nrecs</strong></span> field, and the field should be changed to be
<span class="bold"><strong>qs_nkeys</strong></span>.</p>
    </div>
    <div class="navfooter">
      <hr />
      <table width="100%" summary="Navigation footer">
        <tr>
          <td width="40%" align="left"><a accesskey="p" href="upgrade_3_1_dup.html">Prev</a> </td>
          <td width="20%" align="center">
            <a accesskey="u" href="upgrade_3_1_toc.html">Up</a>
          </td>
          <td width="40%" align="right"> <a accesskey="n" href="upgrade_3_1_sysmem.html">Next</a></td>
        </tr>
        <tr>
          <td width="40%" align="left" valign="top">Release 3.1: identical duplicate data items </td>
          <td width="20%" align="center">
            <a accesskey="h" href="index.html">Home</a>
          </td>
          <td width="40%" align="right" valign="top"> Release 3.1: DB_SYSTEM_MEM</td>
        </tr>
      </table>
    </div>
  </body>
</html>
